﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/AdminMasterPages.master" AutoEventWireup="true" CodeFile="AdminPriceManager.aspx.cs" Inherits="Admin_AdminPriceManager" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <p>
        <br />
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            AutoGenerateEditButton="True" CellPadding="20" CellSpacing="20" 
            DataKeyNames="RES" DataSourceID="SqlDataSource1" EnableModelValidation="True">
            <Columns>
                <asp:BoundField DataField="RES" HeaderText="RES" ReadOnly="True" 
                    SortExpression="RES" />
                <asp:TemplateField HeaderText="Money" SortExpression="Money">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Money") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("Money") %>'></asp:Label>
                        &nbsp;$
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:MyImage_eProjectSem3ConnectionString %>" 
            DeleteCommand="DELETE FROM [Price] WHERE [RES] = @RES" 
            InsertCommand="INSERT INTO [Price] ([RES], [Money]) VALUES (@RES, @Money)" 
            SelectCommand="SELECT * FROM [Price] ORDER BY [Money]" 
            UpdateCommand="UPDATE [Price] SET [Money] = @Money WHERE [RES] = @RES">
            <DeleteParameters>
                <asp:Parameter Name="RES" Type="String" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="RES" Type="String" />
                <asp:Parameter Name="Money" Type="Decimal" />
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="Money" Type="Decimal" />
                <asp:Parameter Name="RES" Type="String" />
            </UpdateParameters>
        </asp:SqlDataSource>
    </p>
    <p>
    </p>
</asp:Content>

